<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>new-window</title>
    <script>
        // 创建子窗口
        function createWindow() {
            ipc.emit("create-window", ["NewWindowName " + new Date().getTime()]);
        }
        // 子窗口创建
        ipc.on("on-create-window-ok", function (id) {
            document.getElementById("msg").innerText = "创建 - 窗口ID: " + id
        });
        // 子窗口关闭
        ipc.on("on-close-window", function (id) {
            document.getElementById("msg").innerText = "关闭 - 窗口ID: " + id
        });
    </script>
</head>
<body style="width: 100%;text-align: center;overflow: hidden;">
<button onclick="createWindow()">创建新窗口</button>
<a href="index.html" target="_blank">超链接打开新窗口</a>
<div id="msg"></div>
</body>
</html>